# Maintainer: Bruno Pagani <archange@archlinux.org>
# Maintainer: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: lillian rose winter <hi@neko.vg>
# Contributor: Evan McCarthy <evan@mccarthy.mn>

pkgname=libretls
pkgver=3.5.2
pkgrel=2
pkgdesc="libtls for OpenSSL"
arch=(loong64 x86_64)
url="https://git.causal.agency/${pkgname}"
license=(ISC BSD MIT)
depends=(openssl)
source=(https://causal.agency/${pkgname}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('59ce9961cb1b1a2859cacb9863eeccc3bbeadf014840a1c61a0ac12ad31bcc9e')
b2sums=('b975326c0bd9c2f4adb511f3a6ad4fc8cd9afccd24a3def0c82bf68473b73b93cd83b8b6b3ffb29fc5ba378a9d4fd902dda933f552a02fec374cd56e1690956e')

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  sed -n '1,/*\//p' tls.c | install -Dm644 /dev/stdin "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
